﻿using B.S.Filtration.ErrorCode;
using B.S.Filtration.Read.Api.Application.Command.ContactPhone;
using B.S.Filtration.Read.Api.Dto;
using MediatR;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Filtration.Read.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ContactPhoneController : ControllerBase
    {

        private readonly IMediator mediator;

        public ContactPhoneController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 显示供应商信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPaging<List<ContactPhoneDto>>> GetContactPhone([FromQuery] GetContactPhoneCommand request)
        {
            try
            {
                return await mediator.Send(request);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
